import request from '/@/utils/request';


export function useFileApi() {
	return {
		// 获取文件列表
		getFiles: (params?:object) => {
			return request({
				url: 'image/',
				method: 'get',
				params
			});
		},
		// 新增文件
		addFile:(data:FormData)=>{
			return request({
				url:'image/',
				method:'post',
				headers:{
					"Content-Type":"multipart/form-data"
				},
				data
			})
		},
		// 更新文件
		updateFile:(data:object)=>{
			return request({
				url:'image/',
				method:'put',
				data
			})
		},
		// 删除文件
		deleteFiles:(data:object)=>{
			return request({
				url:'image/',
				method:'delete',
				data
			})
		},
	};
}
